package com.ruoyi.system.controller;

import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.system.domain.ProfitHistory;
import com.ruoyi.system.domain.StudioAttention;
import com.ruoyi.system.domain.UserInfo;
import com.ruoyi.system.service.IUserInfoService;
import com.ruoyi.system.service.impl.LiveModularServiceImpl;
import com.ruoyi.system.tool.operationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 用户信息Controller
 * 
 * @author ruoyi
 * @date 2021-11-30
 */
@RestController
@RequestMapping("/UserModular")
public class UserModularController extends BaseController
{
    @Autowired
    private LiveModularServiceImpl liveModularService;

    /**
     * 查询用户关注直播间
     */
    @GetMapping("/getStudioAttention")
    public TableDataInfo getStudioAttention(Long userId)
    {
        if(userId==null){
            throw  new operationException("用户编号为空");
        }
        List<StudioAttention> list = liveModularService.selectStudioAttentionList(userId);
        return getDataTable(list);
    }
}
